package com.barneyx.mshinfoplatform.entity.info;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.barneyx.mshinfoplatform.entity.AreaCommonEntity;
import com.barneyx.mshinfoplatform.entity.CommonEntity;
import com.barneyx.mshinfoplatform.entity.enums.ETemplateType;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlCharsetConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlEngineConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "msh_info_cate_list", autoResultMap = true)
@TableCharset(MySqlCharsetConstant.UTF8MB4)
@TableEngine(value = MySqlEngineConstant.MyISAM)
public class InfoCateEntity extends AreaCommonEntity {
    @TableId(value = "info_cate_id", type = IdType.ASSIGN_ID)
    @Column(type = MySqlTypeConstant.BIGINT)
    private String InfoCateId;

    @TableField("info_cate_parent_id")
    @Column(type = MySqlTypeConstant.BIGINT)
    private String InfoCateParentId;

    @TableField("info_cate_name")
    private String InfoCateName;

    @TableField("info_cate_code")
    @Column(type = MySqlTypeConstant.CHAR, length = 20)
    public String InfoCateCode;


    @TableField(exist = false)
    private List<InfoCateEntity> children = new ArrayList<>();

    @TableField("info_cate_show")
    @Column(type = MySqlTypeConstant.BIT)
    private boolean InfoCateIsShow;

    @TableField("info_cate_subtitle")
    private String InfoCateSubTitle;

    @TableField("info_cate_icon")
    private String InfoCateIcon;

    @TableField("info_cate_img_icon")
    private String InfoCateImgIcon;

    @TableField("info_cate_sort")
    @Column(defaultValue = "0")
    private Integer InfoCateSort;

    @TableField("home_show")
    @Column(type = MySqlTypeConstant.BIT, defaultValue = "0",comment = "是否主页显示")
    private boolean HomeShow;

    @TableField("info_cate_type")
    @Column(type = MySqlTypeConstant.TINYINT, defaultValue = "101", comment = "模版类型，这个参数将决定详情页使用的是那个模板来展示详情")
    private ETemplateType TemplateType;

    @TableField("post_page_show")
    @Column(type = MySqlTypeConstant.BIT, defaultValue = "0", comment = "是否发布面显示")
    private boolean PostHomeShow;

    @TableField("global_info_show")
    @Column(type = MySqlTypeConstant.TINYINT, defaultValue = "0", comment = "是否全局信息栏显示")
    private Boolean GlobalInfoShow;

    @TableField("info_cate_path")
    @Column(type = MySqlTypeConstant.VARCHAR, defaultValue = "NULL", comment = "直接打开路径")
    private String InfoCatePath;

}
